import '../../util/_base_export.dart';
import '../../util/_view_export.dart';

class DealsItemComponent extends StatelessWidget {
  final String iv_img;
  final String iv_title;
  final String iv_descr;

  DealsItemComponent({
    Key? key,
    required this.iv_img,
    this.iv_title='',
    this.iv_descr='',
  }) : super(key: key);

  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.start,
      children: <Widget>[
        Container(
          width: 110.w,
          height: 110.h,
          child: CachedNetworkImage(
            imageUrl: iv_img,
            fit: BoxFit.cover,
          ),
        ),
        Flexible(
          child: Container(
            height: 110.h,
            padding: EdgeInsets.symmetric(
              vertical: 2.h,
              horizontal: 15.w,
            ),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Text(
                  iv_title,
                  softWrap: true,
                  maxLines: 2,
                  overflow: TextOverflow.fade,
                  style: TextStyle(
                    color: Colors.black,
                    fontWeight: FontWeight.bold,
                    fontSize: 14.sp,
                  ),
                ),
                Text(
                  " ",
                  style: TextStyle(
                    color: Colors.grey,
                    fontWeight: FontWeight.normal,
                    fontSize: 10.sp,
                  ),
                ),
                Text(
                  iv_descr,
                  softWrap: true,
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                  style: TextStyle(
                    color: Colors.grey,
                    fontWeight: FontWeight.normal,
                    fontSize: 13.sp,
                  ),
                ),
              ],
            ),
          ),
        ),
      ],
    );
  }
}
